Page({
  data: {
    url: '',
    callback: null
  },
  onLoad: function (options) {
    const eventChannel = this.getOpenerEventChannel()
    let that = this
    eventChannel.on('acceptDataFromOpenerPage', function (data) {
      if(data.callback) {
        that.setData({
          url: data.url,
          callback: data.callback
        })
      } else {
        that.setData({
          url: data.url,
        })
      }
    })
  },
  onPullDownRefresh: function () {
    this.setData({
      url: this.data.url
    })
  },
  onUnload: function() {
    if(this.data.callback) {
      callback()
    }
  }
})